package com.taoym.voucher.common.enums;

import lombok.Getter;

/**
 * @coder taoym
 * @datetime 2021/6/13 9:35
 * @desc 用户提现状态枚举
 */
@Getter
public enum UserWithdrawStatusEnum implements EnumsCommon {

    IS_APPLY(1, "#0192ff", "已申请"),
    SUCCESS(2, "#68c632", "提现成功"),
    FAIL(3, "#f20108", "提现失败"),
    ;

    private final Integer code;
    private final String color;
    private final String msg;

    UserWithdrawStatusEnum(Integer code, String color, String msg) {
        this.code = code;
        this.color = color;
        this.msg = msg;
    }

    public static String getMsg(Integer code) {
        for (UserWithdrawStatusEnum value : values()) {
            if (code.equals(value.code)) {
                return value.msg;
            }
        }
        return null;
    }

    public static String getColor(Integer code) {
        for (UserWithdrawStatusEnum value : values()) {
            if (code.equals(value.code)) {
                return value.color;
            }
        }
        return null;
    }
}
